home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: MegaDisc
/
MegaDisc 30 (1992-10)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].zip
/
MegaDisc 30 (1992-10)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].adf
/
Tutes_&_CLI
/
Data_Recovery
< prev
next >
Wrap
Text File
|
1992-10-05
|
10KB
|
172 lines
D A T A R E C O V E R Y
-------------------------
by Paul McLachlan
Ed: For those who have wondered what a read/write error is, or how to get
a deleted file back, this is just the ticket.
### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ###
THE BASICS
The process of data recovery has been around since people started making
mistakes with computers, and the data that they hold. That is, data
recovery has been with us from the start. People, being people, have a
nasty tendency to make mistakes, to have accidents. This has led to the
race for one of two things: Perfection, where the person would not make
mistakes, as well as the ability to undo that which was done - in this
case, recovering the data. Perfection, I am afraid, I cannot help you
achieve. People have striven for perfection all their lives and not made
it. While you are busy striving, might I suggest this alternative method?
Besides, once you achieve perfection you might not make any mistakes, but
you still have mistakes that you made previously. Data Recovery is the key
to "undo"ing some of those mistakes that you might have made (but would
never own up to).
Knowledge is power
One of the major problems with data recovery is a lack of knowledge. Not
knowledge on how to do it, you can always ask somebody that, but the lack
of knowledge that it is possible. You see, when you delete a file from a
disk, it is very easy to give up and retype the entire document. You do
this immediately, and without much thought, in an attempt to save as much
time as possible, as it may have taken hours to type out that whole
document. What does not immediately present itself is the fact that it is
usually quite possible to get back a recently deleted file - and it doesn't
help that the Commodore manuals say next to nothing about it. When you
have a major 'accident' take some time to consider what you have done, and,
more importantly, whether or not you can 'undo' it, to save yourself the
work that you have just lost.
Two types of recovery
There are really two general types of data recovery. There is deleted
file recovery and scrambled data recovery. Under deleted file we have the
'delete #? all' command. Try it and see what it does (heh, heh). Under
scrambled data recovery we have things such as computers who have been
turned off while a task was writing to the drive; we have general disk
(hard error) failures; we have dust collecting on the disk drive, and a
whole host of things that could befall your data. Oh yeah, about that
'delete #? all' command, I was joking when I said try it. If you really
did try it, then you may have a real motive to read the rest of this
article. Morale of the story: Before you try anything, read the rest of
the paragraph.
Let me deal first with deleted file data recovery. This involves, as I
have previously stated, files that you have deleted from the disk. This is
possible due to the way in which AmigaDOS deletes files from the disk.
Here's a brief summary:
When AmigaDOS wants to write data to a disk with a file name, it first
goes to the directory of the disk, and makes a new entry. It writes the
name of the file, the date, protection bits, filenotes and other info
about the file into this directory, which is on the root block of the disk
(Lower side of cylinder 40). It then searches through this directory
block, and works out where on the disk is free (unallocated for data) disk
space. It then writes the location of this disk space into the directory
head, and begins writing the data at this location of previously free disk
space. The disk could be fragmented, and it may have to use various
blocks, but that is another story, and shall be told another time (to keep
this from being a circular segment of the article). Once it finishes, then
the access to the drive is finished. When you then want to load that data
off the disk, then it reads the directory block, so that it can find the
first part of the data, and it then just reads it off the disk, starting at
that location.
When you decide that you no longer want a file (or, to be accurate, tell
AmigaDOS you no longer want a file - whether you actually want it or not)
then AmigaDOS will remove the file from the disk by taking that files entry
out of the directory block, and setting the space it took up as free.
That's it. No communal sacrifices at dawn, and no resetting every single
part of that file to nothing. This means that deleting a file is often
quicker than reading and writing it. It also means the file is still on
the disk. Unfortunately, it won't stay there forever. Next time you write
a file to the disk, and AmigaDOS finds some free disk space, it may well be
the space that was taken up by your deleted file, since this space is now
'free'. Of course, on an empty disk, there is more chance it will find
some other space then on a disk which is 97% full, and that was the only
free space on the disk at all. And so, your data is still there after a
delete, for the time being.
Recovering this data is quite simple with a program that does it -
diskdoctor, fixdisk, disksalv, lasthope, just to name a few. The program
does it by simply scanning every location on the disk, looking for files.
It then creates a list of every file which it thinks should be on the disk,
and cross-references this with what is listed in the directory. What it
doesn't find has been deleted. When it undeletes, it must simply check
that the file is all there, and then write an entry into the directory
listing for that file, giving its location on the disk, and setting its
space to 'used' (as opposed to free).
Scrambled data recovery is a different story altogether. The entry in the
directory listing is probably still there, but some of the data in the
actual file has changed. This could do many things, such as scrambled text
in a dåæð#¶øµ¤ or a sound file having static in it. It might cause a
program to GURU, or a picture to be distorted. It could do any of these
things, but you've never seen it, have you. Why? Because captain AmigaDOS
keeps something called a checksum on his data. The way it works, is that
he runs the data through a (usually simple) algorithm, and stores the
result of that on disk, near the file. Whenever he reads that file in, he
re-does the algorithm on the data he reads in, and if it doesn't match with
the checksum recorded on the disk, then he gives a read/write error, and
stops - never giving the error the chance to manifest itself in nasty ways.
This read/write error is often your first warning of some scrambled data,
and the last thing you should do is panic. If you have never seen a
scrambled data error, and want one to try and fix, I'll give you a
foolproof way of getting one (my evil ways coming out again, I'm afraid).
Here goes: Get a very large file, and copy it to another disk, while the
drive light is on, hit control-amiga-amiga. Wow! What fun. You could
have taken the disk out of the drive, but then you get a second chance.
You have just totally wrecked that file on the disk, only having saved half
of something, and probably not getting the correct checksum on it. Boot up
again and put the disk in the drive. See all the requesters flying at you
from nowhere? Well, now you've seen what happens. Oh, don't try that too
often, it's possible (in fact likely) that it does damage the disk or the
drive in some way, causing extra wear and tear.
It's possible after all this that your data is still somewhere on that
disk, and the tiny glitch in data that caused the checksum to sound the
alarm quite small. The various programs do this type of recovery in
various ways, but a common method is to just read the block in, set the
checksums to the correct values, and let the user try the thing, to see how
well it worked. This, believe it or not, often works.
So know you have a general idea of how data recovery on magnetic medium
works, and hopefully this will help you. The most important thing to do
when something like this happens - is not to work on the original disk
unless you are sure you know what you're doing, and remember that it is
possible to get something back, so don't just reformat the disk and start
over.
Kind offer
If you have any data recovery problems on any of your disks, then you
might want to send it to me - I'll have a look at it for you, and see if I
can fix it. But please, if you want me to do any of this, include a SASE
(Self Addressed, Stamped Envelope) for me to get the disk back to you. I'm
not saying that I'm an expert, but I've recovered a lot of disks in my
time, from commercial games to simple data disks, and I know what I'm
doing. Send me the original disk as well as another blank disk. At worst,
you'll get the original disk and blank disk back blank. At best, you'll
get the original and blank disk back - with everything nice and recovered
on the original disk. You can then send me a note of extreme appreciation,
and perhaps a small donation? Anyway, here is my address:
Paul Mclachlan
60 Hatfield street
Blakehurst, Sydney
NSW, 2221
### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ###